package com.lovo.bbs.bo;

import java.sql.SQLException;

import javax.naming.NamingException;

import com.lovo.bbs.dao.LoginDao;
import com.lovo.bbs.po.LoginPo;
import com.lovo.bbs.vo.LoginVo;

/**
 * 登录Bo
 * 
 * @author tiancen2001
 * 
 */
public class LoginBo {
	public static  final int TYPE_OF_MEMBER=0;//普通会员标志
	public static  final int TYPE_OF_MODERATOR=1;//版主标志
	public static  final int TYPE_OF_ADMIN=2;//超级管理员标志

	/**
	 * 登录校验
	 * @param loginvo
	 * @param type 用户类型
	 * @return
	 * @throws NamingException
	 * @throws SQLException
	 */
	public  boolean checkUser(LoginVo loginvo,int type) throws NamingException, SQLException {
		LoginPo loginpo = new LoginPo();
		loginpo.setUserName(loginvo.getUserName());
		loginpo.setUserPassword(loginvo.getPassword());
		boolean isUser =  new LoginDao().checkUser(loginpo,type);
		return isUser;
	}
}
